package com.xjgzinfo.usdp.web.rest;

import com.xjgzinfo.usdp.AvueServer4jApp;
import com.xjgzinfo.usdp.config.TestSecurityConfiguration;
import com.xjgzinfo.usdp.domain.SysTheme;
import com.xjgzinfo.usdp.repository.SysThemeRepository;
import com.xjgzinfo.usdp.service.SysThemeService;
import com.xjgzinfo.usdp.service.dto.SysThemeDTO;
import com.xjgzinfo.usdp.service.mapper.SysThemeMapper;
import com.xjgzinfo.usdp.service.dto.SysThemeCriteria;
import com.xjgzinfo.usdp.service.SysThemeQueryService;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.EntityManager;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;

/**
 * Integration tests for the {@link SysThemeResource} REST controller.
 */
@SpringBootTest(classes = { AvueServer4jApp.class, TestSecurityConfiguration.class })
@AutoConfigureMockMvc
@WithMockUser
public class SysThemeResourceIT {

    private static final String DEFAULT_PRIMARYCOLOR = "AAAAAAAAAA";
    private static final String UPDATED_PRIMARYCOLOR = "BBBBBBBBBB";

    private static final String DEFAULT_INFOCOLOR = "AAAAAAAAAA";
    private static final String UPDATED_INFOCOLOR = "BBBBBBBBBB";

    private static final String DEFAULT_SUCCESSCOLOR = "AAAAAAAAAA";
    private static final String UPDATED_SUCCESSCOLOR = "BBBBBBBBBB";

    private static final String DEFAULT_WARNINGCOLOR = "AAAAAAAAAA";
    private static final String UPDATED_WARNINGCOLOR = "BBBBBBBBBB";

    private static final String DEFAULT_ERRORCOLOR = "AAAAAAAAAA";
    private static final String UPDATED_ERRORCOLOR = "BBBBBBBBBB";

    private static final String DEFAULT_ERRORBGCOLOR = "AAAAAAAAAA";
    private static final String UPDATED_ERRORBGCOLOR = "BBBBBBBBBB";

    private static final String DEFAULT_PROCESSINGCOLOR = "AAAAAAAAAA";
    private static final String UPDATED_PROCESSINGCOLOR = "BBBBBBBBBB";

    private static final String DEFAULT_HIGHLIGHTCOLOR = "AAAAAAAAAA";
    private static final String UPDATED_HIGHLIGHTCOLOR = "BBBBBBBBBB";

    private static final String DEFAULT_LINKCOLOR = "AAAAAAAAAA";
    private static final String UPDATED_LINKCOLOR = "BBBBBBBBBB";

    private static final String DEFAULT_NORMALCOLOR = "AAAAAAAAAA";
    private static final String UPDATED_NORMALCOLOR = "BBBBBBBBBB";

    private static final Long DEFAULT_TENANT_ID = 1L;
    private static final Long UPDATED_TENANT_ID = 2L;
    private static final Long SMALLER_TENANT_ID = 1L - 1L;

    @Autowired
    private SysThemeRepository sysThemeRepository;

    @Autowired
    private SysThemeMapper sysThemeMapper;

    @Autowired
    private SysThemeService sysThemeService;

    @Autowired
    private SysThemeQueryService sysThemeQueryService;

    @Autowired
    private EntityManager em;

    @Autowired
    private MockMvc restSysThemeMockMvc;

    private SysTheme sysTheme;

    /**
     * Create an entity for this test.
     *
     * This is a static method, as tests for other entities might also need it,
     * if they test an entity which requires the current entity.
     */
    public static SysTheme createEntity(EntityManager em) {
        SysTheme sysTheme = new SysTheme()
            .primarycolor(DEFAULT_PRIMARYCOLOR)
            .infocolor(DEFAULT_INFOCOLOR)
            .successcolor(DEFAULT_SUCCESSCOLOR)
            .warningcolor(DEFAULT_WARNINGCOLOR)
            .errorcolor(DEFAULT_ERRORCOLOR)
            .errorbgcolor(DEFAULT_ERRORBGCOLOR)
            .processingcolor(DEFAULT_PROCESSINGCOLOR)
            .highlightcolor(DEFAULT_HIGHLIGHTCOLOR)
            .linkcolor(DEFAULT_LINKCOLOR)
            .normalcolor(DEFAULT_NORMALCOLOR)
            .tenantId(DEFAULT_TENANT_ID);
        return sysTheme;
    }
    /**
     * Create an updated entity for this test.
     *
     * This is a static method, as tests for other entities might also need it,
     * if they test an entity which requires the current entity.
     */
    public static SysTheme createUpdatedEntity(EntityManager em) {
        SysTheme sysTheme = new SysTheme()
            .primarycolor(UPDATED_PRIMARYCOLOR)
            .infocolor(UPDATED_INFOCOLOR)
            .successcolor(UPDATED_SUCCESSCOLOR)
            .warningcolor(UPDATED_WARNINGCOLOR)
            .errorcolor(UPDATED_ERRORCOLOR)
            .errorbgcolor(UPDATED_ERRORBGCOLOR)
            .processingcolor(UPDATED_PROCESSINGCOLOR)
            .highlightcolor(UPDATED_HIGHLIGHTCOLOR)
            .linkcolor(UPDATED_LINKCOLOR)
            .normalcolor(UPDATED_NORMALCOLOR)
            .tenantId(UPDATED_TENANT_ID);
        return sysTheme;
    }

    @BeforeEach
    public void initTest() {
        sysTheme = createEntity(em);
    }

    @Test
    @Transactional
    public void createSysTheme() throws Exception {
        int databaseSizeBeforeCreate = sysThemeRepository.findAll().size();
        // Create the SysTheme
        SysThemeDTO sysThemeDTO = sysThemeMapper.toDto(sysTheme);
        restSysThemeMockMvc.perform(post("/api/sys-themes").with(csrf())
            .contentType(MediaType.APPLICATION_JSON)
            .content(TestUtil.convertObjectToJsonBytes(sysThemeDTO)))
            .andExpect(status().isCreated());

        // Validate the SysTheme in the database
        List<SysTheme> sysThemeList = sysThemeRepository.findAll();
        assertThat(sysThemeList).hasSize(databaseSizeBeforeCreate + 1);
        SysTheme testSysTheme = sysThemeList.get(sysThemeList.size() - 1);
        assertThat(testSysTheme.getPrimarycolor()).isEqualTo(DEFAULT_PRIMARYCOLOR);
        assertThat(testSysTheme.getInfocolor()).isEqualTo(DEFAULT_INFOCOLOR);
        assertThat(testSysTheme.getSuccesscolor()).isEqualTo(DEFAULT_SUCCESSCOLOR);
        assertThat(testSysTheme.getWarningcolor()).isEqualTo(DEFAULT_WARNINGCOLOR);
        assertThat(testSysTheme.getErrorcolor()).isEqualTo(DEFAULT_ERRORCOLOR);
        assertThat(testSysTheme.getErrorbgcolor()).isEqualTo(DEFAULT_ERRORBGCOLOR);
        assertThat(testSysTheme.getProcessingcolor()).isEqualTo(DEFAULT_PROCESSINGCOLOR);
        assertThat(testSysTheme.getHighlightcolor()).isEqualTo(DEFAULT_HIGHLIGHTCOLOR);
        assertThat(testSysTheme.getLinkcolor()).isEqualTo(DEFAULT_LINKCOLOR);
        assertThat(testSysTheme.getNormalcolor()).isEqualTo(DEFAULT_NORMALCOLOR);
        assertThat(testSysTheme.getTenantId()).isEqualTo(DEFAULT_TENANT_ID);
    }

    @Test
    @Transactional
    public void createSysThemeWithExistingId() throws Exception {
        int databaseSizeBeforeCreate = sysThemeRepository.findAll().size();

        // Create the SysTheme with an existing ID
        sysTheme.setId(1L);
        SysThemeDTO sysThemeDTO = sysThemeMapper.toDto(sysTheme);

        // An entity with an existing ID cannot be created, so this API call must fail
        restSysThemeMockMvc.perform(post("/api/sys-themes").with(csrf())
            .contentType(MediaType.APPLICATION_JSON)
            .content(TestUtil.convertObjectToJsonBytes(sysThemeDTO)))
            .andExpect(status().isBadRequest());

        // Validate the SysTheme in the database
        List<SysTheme> sysThemeList = sysThemeRepository.findAll();
        assertThat(sysThemeList).hasSize(databaseSizeBeforeCreate);
    }


    @Test
    @Transactional
    public void getAllSysThemes() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList
        restSysThemeMockMvc.perform(get("/api/sys-themes?sort=id,desc"))
            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
            .andExpect(jsonPath("$.[*].id").value(hasItem(sysTheme.getId().intValue())))
            .andExpect(jsonPath("$.[*].primarycolor").value(hasItem(DEFAULT_PRIMARYCOLOR)))
            .andExpect(jsonPath("$.[*].infocolor").value(hasItem(DEFAULT_INFOCOLOR)))
            .andExpect(jsonPath("$.[*].successcolor").value(hasItem(DEFAULT_SUCCESSCOLOR)))
            .andExpect(jsonPath("$.[*].warningcolor").value(hasItem(DEFAULT_WARNINGCOLOR)))
            .andExpect(jsonPath("$.[*].errorcolor").value(hasItem(DEFAULT_ERRORCOLOR)))
            .andExpect(jsonPath("$.[*].errorbgcolor").value(hasItem(DEFAULT_ERRORBGCOLOR)))
            .andExpect(jsonPath("$.[*].processingcolor").value(hasItem(DEFAULT_PROCESSINGCOLOR)))
            .andExpect(jsonPath("$.[*].highlightcolor").value(hasItem(DEFAULT_HIGHLIGHTCOLOR)))
            .andExpect(jsonPath("$.[*].linkcolor").value(hasItem(DEFAULT_LINKCOLOR)))
            .andExpect(jsonPath("$.[*].normalcolor").value(hasItem(DEFAULT_NORMALCOLOR)))
            .andExpect(jsonPath("$.[*].tenantId").value(hasItem(DEFAULT_TENANT_ID.intValue())));
    }
    
    @Test
    @Transactional
    public void getSysTheme() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get the sysTheme
        restSysThemeMockMvc.perform(get("/api/sys-themes/{id}", sysTheme.getId()))
            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
            .andExpect(jsonPath("$.id").value(sysTheme.getId().intValue()))
            .andExpect(jsonPath("$.primarycolor").value(DEFAULT_PRIMARYCOLOR))
            .andExpect(jsonPath("$.infocolor").value(DEFAULT_INFOCOLOR))
            .andExpect(jsonPath("$.successcolor").value(DEFAULT_SUCCESSCOLOR))
            .andExpect(jsonPath("$.warningcolor").value(DEFAULT_WARNINGCOLOR))
            .andExpect(jsonPath("$.errorcolor").value(DEFAULT_ERRORCOLOR))
            .andExpect(jsonPath("$.errorbgcolor").value(DEFAULT_ERRORBGCOLOR))
            .andExpect(jsonPath("$.processingcolor").value(DEFAULT_PROCESSINGCOLOR))
            .andExpect(jsonPath("$.highlightcolor").value(DEFAULT_HIGHLIGHTCOLOR))
            .andExpect(jsonPath("$.linkcolor").value(DEFAULT_LINKCOLOR))
            .andExpect(jsonPath("$.normalcolor").value(DEFAULT_NORMALCOLOR))
            .andExpect(jsonPath("$.tenantId").value(DEFAULT_TENANT_ID.intValue()));
    }


    @Test
    @Transactional
    public void getSysThemesByIdFiltering() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        Long id = sysTheme.getId();

        defaultSysThemeShouldBeFound("id.equals=" + id);
        defaultSysThemeShouldNotBeFound("id.notEquals=" + id);

        defaultSysThemeShouldBeFound("id.greaterThanOrEqual=" + id);
        defaultSysThemeShouldNotBeFound("id.greaterThan=" + id);

        defaultSysThemeShouldBeFound("id.lessThanOrEqual=" + id);
        defaultSysThemeShouldNotBeFound("id.lessThan=" + id);
    }


    @Test
    @Transactional
    public void getAllSysThemesByPrimarycolorIsEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where primarycolor equals to DEFAULT_PRIMARYCOLOR
        defaultSysThemeShouldBeFound("primarycolor.equals=" + DEFAULT_PRIMARYCOLOR);

        // Get all the sysThemeList where primarycolor equals to UPDATED_PRIMARYCOLOR
        defaultSysThemeShouldNotBeFound("primarycolor.equals=" + UPDATED_PRIMARYCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByPrimarycolorIsNotEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where primarycolor not equals to DEFAULT_PRIMARYCOLOR
        defaultSysThemeShouldNotBeFound("primarycolor.notEquals=" + DEFAULT_PRIMARYCOLOR);

        // Get all the sysThemeList where primarycolor not equals to UPDATED_PRIMARYCOLOR
        defaultSysThemeShouldBeFound("primarycolor.notEquals=" + UPDATED_PRIMARYCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByPrimarycolorIsInShouldWork() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where primarycolor in DEFAULT_PRIMARYCOLOR or UPDATED_PRIMARYCOLOR
        defaultSysThemeShouldBeFound("primarycolor.in=" + DEFAULT_PRIMARYCOLOR + "," + UPDATED_PRIMARYCOLOR);

        // Get all the sysThemeList where primarycolor equals to UPDATED_PRIMARYCOLOR
        defaultSysThemeShouldNotBeFound("primarycolor.in=" + UPDATED_PRIMARYCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByPrimarycolorIsNullOrNotNull() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where primarycolor is not null
        defaultSysThemeShouldBeFound("primarycolor.specified=true");

        // Get all the sysThemeList where primarycolor is null
        defaultSysThemeShouldNotBeFound("primarycolor.specified=false");
    }
                @Test
    @Transactional
    public void getAllSysThemesByPrimarycolorContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where primarycolor contains DEFAULT_PRIMARYCOLOR
        defaultSysThemeShouldBeFound("primarycolor.contains=" + DEFAULT_PRIMARYCOLOR);

        // Get all the sysThemeList where primarycolor contains UPDATED_PRIMARYCOLOR
        defaultSysThemeShouldNotBeFound("primarycolor.contains=" + UPDATED_PRIMARYCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByPrimarycolorNotContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where primarycolor does not contain DEFAULT_PRIMARYCOLOR
        defaultSysThemeShouldNotBeFound("primarycolor.doesNotContain=" + DEFAULT_PRIMARYCOLOR);

        // Get all the sysThemeList where primarycolor does not contain UPDATED_PRIMARYCOLOR
        defaultSysThemeShouldBeFound("primarycolor.doesNotContain=" + UPDATED_PRIMARYCOLOR);
    }


    @Test
    @Transactional
    public void getAllSysThemesByInfocolorIsEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where infocolor equals to DEFAULT_INFOCOLOR
        defaultSysThemeShouldBeFound("infocolor.equals=" + DEFAULT_INFOCOLOR);

        // Get all the sysThemeList where infocolor equals to UPDATED_INFOCOLOR
        defaultSysThemeShouldNotBeFound("infocolor.equals=" + UPDATED_INFOCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByInfocolorIsNotEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where infocolor not equals to DEFAULT_INFOCOLOR
        defaultSysThemeShouldNotBeFound("infocolor.notEquals=" + DEFAULT_INFOCOLOR);

        // Get all the sysThemeList where infocolor not equals to UPDATED_INFOCOLOR
        defaultSysThemeShouldBeFound("infocolor.notEquals=" + UPDATED_INFOCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByInfocolorIsInShouldWork() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where infocolor in DEFAULT_INFOCOLOR or UPDATED_INFOCOLOR
        defaultSysThemeShouldBeFound("infocolor.in=" + DEFAULT_INFOCOLOR + "," + UPDATED_INFOCOLOR);

        // Get all the sysThemeList where infocolor equals to UPDATED_INFOCOLOR
        defaultSysThemeShouldNotBeFound("infocolor.in=" + UPDATED_INFOCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByInfocolorIsNullOrNotNull() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where infocolor is not null
        defaultSysThemeShouldBeFound("infocolor.specified=true");

        // Get all the sysThemeList where infocolor is null
        defaultSysThemeShouldNotBeFound("infocolor.specified=false");
    }
                @Test
    @Transactional
    public void getAllSysThemesByInfocolorContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where infocolor contains DEFAULT_INFOCOLOR
        defaultSysThemeShouldBeFound("infocolor.contains=" + DEFAULT_INFOCOLOR);

        // Get all the sysThemeList where infocolor contains UPDATED_INFOCOLOR
        defaultSysThemeShouldNotBeFound("infocolor.contains=" + UPDATED_INFOCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByInfocolorNotContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where infocolor does not contain DEFAULT_INFOCOLOR
        defaultSysThemeShouldNotBeFound("infocolor.doesNotContain=" + DEFAULT_INFOCOLOR);

        // Get all the sysThemeList where infocolor does not contain UPDATED_INFOCOLOR
        defaultSysThemeShouldBeFound("infocolor.doesNotContain=" + UPDATED_INFOCOLOR);
    }


    @Test
    @Transactional
    public void getAllSysThemesBySuccesscolorIsEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where successcolor equals to DEFAULT_SUCCESSCOLOR
        defaultSysThemeShouldBeFound("successcolor.equals=" + DEFAULT_SUCCESSCOLOR);

        // Get all the sysThemeList where successcolor equals to UPDATED_SUCCESSCOLOR
        defaultSysThemeShouldNotBeFound("successcolor.equals=" + UPDATED_SUCCESSCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesBySuccesscolorIsNotEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where successcolor not equals to DEFAULT_SUCCESSCOLOR
        defaultSysThemeShouldNotBeFound("successcolor.notEquals=" + DEFAULT_SUCCESSCOLOR);

        // Get all the sysThemeList where successcolor not equals to UPDATED_SUCCESSCOLOR
        defaultSysThemeShouldBeFound("successcolor.notEquals=" + UPDATED_SUCCESSCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesBySuccesscolorIsInShouldWork() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where successcolor in DEFAULT_SUCCESSCOLOR or UPDATED_SUCCESSCOLOR
        defaultSysThemeShouldBeFound("successcolor.in=" + DEFAULT_SUCCESSCOLOR + "," + UPDATED_SUCCESSCOLOR);

        // Get all the sysThemeList where successcolor equals to UPDATED_SUCCESSCOLOR
        defaultSysThemeShouldNotBeFound("successcolor.in=" + UPDATED_SUCCESSCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesBySuccesscolorIsNullOrNotNull() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where successcolor is not null
        defaultSysThemeShouldBeFound("successcolor.specified=true");

        // Get all the sysThemeList where successcolor is null
        defaultSysThemeShouldNotBeFound("successcolor.specified=false");
    }
                @Test
    @Transactional
    public void getAllSysThemesBySuccesscolorContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where successcolor contains DEFAULT_SUCCESSCOLOR
        defaultSysThemeShouldBeFound("successcolor.contains=" + DEFAULT_SUCCESSCOLOR);

        // Get all the sysThemeList where successcolor contains UPDATED_SUCCESSCOLOR
        defaultSysThemeShouldNotBeFound("successcolor.contains=" + UPDATED_SUCCESSCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesBySuccesscolorNotContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where successcolor does not contain DEFAULT_SUCCESSCOLOR
        defaultSysThemeShouldNotBeFound("successcolor.doesNotContain=" + DEFAULT_SUCCESSCOLOR);

        // Get all the sysThemeList where successcolor does not contain UPDATED_SUCCESSCOLOR
        defaultSysThemeShouldBeFound("successcolor.doesNotContain=" + UPDATED_SUCCESSCOLOR);
    }


    @Test
    @Transactional
    public void getAllSysThemesByWarningcolorIsEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where warningcolor equals to DEFAULT_WARNINGCOLOR
        defaultSysThemeShouldBeFound("warningcolor.equals=" + DEFAULT_WARNINGCOLOR);

        // Get all the sysThemeList where warningcolor equals to UPDATED_WARNINGCOLOR
        defaultSysThemeShouldNotBeFound("warningcolor.equals=" + UPDATED_WARNINGCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByWarningcolorIsNotEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where warningcolor not equals to DEFAULT_WARNINGCOLOR
        defaultSysThemeShouldNotBeFound("warningcolor.notEquals=" + DEFAULT_WARNINGCOLOR);

        // Get all the sysThemeList where warningcolor not equals to UPDATED_WARNINGCOLOR
        defaultSysThemeShouldBeFound("warningcolor.notEquals=" + UPDATED_WARNINGCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByWarningcolorIsInShouldWork() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where warningcolor in DEFAULT_WARNINGCOLOR or UPDATED_WARNINGCOLOR
        defaultSysThemeShouldBeFound("warningcolor.in=" + DEFAULT_WARNINGCOLOR + "," + UPDATED_WARNINGCOLOR);

        // Get all the sysThemeList where warningcolor equals to UPDATED_WARNINGCOLOR
        defaultSysThemeShouldNotBeFound("warningcolor.in=" + UPDATED_WARNINGCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByWarningcolorIsNullOrNotNull() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where warningcolor is not null
        defaultSysThemeShouldBeFound("warningcolor.specified=true");

        // Get all the sysThemeList where warningcolor is null
        defaultSysThemeShouldNotBeFound("warningcolor.specified=false");
    }
                @Test
    @Transactional
    public void getAllSysThemesByWarningcolorContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where warningcolor contains DEFAULT_WARNINGCOLOR
        defaultSysThemeShouldBeFound("warningcolor.contains=" + DEFAULT_WARNINGCOLOR);

        // Get all the sysThemeList where warningcolor contains UPDATED_WARNINGCOLOR
        defaultSysThemeShouldNotBeFound("warningcolor.contains=" + UPDATED_WARNINGCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByWarningcolorNotContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where warningcolor does not contain DEFAULT_WARNINGCOLOR
        defaultSysThemeShouldNotBeFound("warningcolor.doesNotContain=" + DEFAULT_WARNINGCOLOR);

        // Get all the sysThemeList where warningcolor does not contain UPDATED_WARNINGCOLOR
        defaultSysThemeShouldBeFound("warningcolor.doesNotContain=" + UPDATED_WARNINGCOLOR);
    }


    @Test
    @Transactional
    public void getAllSysThemesByErrorcolorIsEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where errorcolor equals to DEFAULT_ERRORCOLOR
        defaultSysThemeShouldBeFound("errorcolor.equals=" + DEFAULT_ERRORCOLOR);

        // Get all the sysThemeList where errorcolor equals to UPDATED_ERRORCOLOR
        defaultSysThemeShouldNotBeFound("errorcolor.equals=" + UPDATED_ERRORCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByErrorcolorIsNotEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where errorcolor not equals to DEFAULT_ERRORCOLOR
        defaultSysThemeShouldNotBeFound("errorcolor.notEquals=" + DEFAULT_ERRORCOLOR);

        // Get all the sysThemeList where errorcolor not equals to UPDATED_ERRORCOLOR
        defaultSysThemeShouldBeFound("errorcolor.notEquals=" + UPDATED_ERRORCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByErrorcolorIsInShouldWork() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where errorcolor in DEFAULT_ERRORCOLOR or UPDATED_ERRORCOLOR
        defaultSysThemeShouldBeFound("errorcolor.in=" + DEFAULT_ERRORCOLOR + "," + UPDATED_ERRORCOLOR);

        // Get all the sysThemeList where errorcolor equals to UPDATED_ERRORCOLOR
        defaultSysThemeShouldNotBeFound("errorcolor.in=" + UPDATED_ERRORCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByErrorcolorIsNullOrNotNull() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where errorcolor is not null
        defaultSysThemeShouldBeFound("errorcolor.specified=true");

        // Get all the sysThemeList where errorcolor is null
        defaultSysThemeShouldNotBeFound("errorcolor.specified=false");
    }
                @Test
    @Transactional
    public void getAllSysThemesByErrorcolorContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where errorcolor contains DEFAULT_ERRORCOLOR
        defaultSysThemeShouldBeFound("errorcolor.contains=" + DEFAULT_ERRORCOLOR);

        // Get all the sysThemeList where errorcolor contains UPDATED_ERRORCOLOR
        defaultSysThemeShouldNotBeFound("errorcolor.contains=" + UPDATED_ERRORCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByErrorcolorNotContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where errorcolor does not contain DEFAULT_ERRORCOLOR
        defaultSysThemeShouldNotBeFound("errorcolor.doesNotContain=" + DEFAULT_ERRORCOLOR);

        // Get all the sysThemeList where errorcolor does not contain UPDATED_ERRORCOLOR
        defaultSysThemeShouldBeFound("errorcolor.doesNotContain=" + UPDATED_ERRORCOLOR);
    }


    @Test
    @Transactional
    public void getAllSysThemesByErrorbgcolorIsEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where errorbgcolor equals to DEFAULT_ERRORBGCOLOR
        defaultSysThemeShouldBeFound("errorbgcolor.equals=" + DEFAULT_ERRORBGCOLOR);

        // Get all the sysThemeList where errorbgcolor equals to UPDATED_ERRORBGCOLOR
        defaultSysThemeShouldNotBeFound("errorbgcolor.equals=" + UPDATED_ERRORBGCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByErrorbgcolorIsNotEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where errorbgcolor not equals to DEFAULT_ERRORBGCOLOR
        defaultSysThemeShouldNotBeFound("errorbgcolor.notEquals=" + DEFAULT_ERRORBGCOLOR);

        // Get all the sysThemeList where errorbgcolor not equals to UPDATED_ERRORBGCOLOR
        defaultSysThemeShouldBeFound("errorbgcolor.notEquals=" + UPDATED_ERRORBGCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByErrorbgcolorIsInShouldWork() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where errorbgcolor in DEFAULT_ERRORBGCOLOR or UPDATED_ERRORBGCOLOR
        defaultSysThemeShouldBeFound("errorbgcolor.in=" + DEFAULT_ERRORBGCOLOR + "," + UPDATED_ERRORBGCOLOR);

        // Get all the sysThemeList where errorbgcolor equals to UPDATED_ERRORBGCOLOR
        defaultSysThemeShouldNotBeFound("errorbgcolor.in=" + UPDATED_ERRORBGCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByErrorbgcolorIsNullOrNotNull() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where errorbgcolor is not null
        defaultSysThemeShouldBeFound("errorbgcolor.specified=true");

        // Get all the sysThemeList where errorbgcolor is null
        defaultSysThemeShouldNotBeFound("errorbgcolor.specified=false");
    }
                @Test
    @Transactional
    public void getAllSysThemesByErrorbgcolorContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where errorbgcolor contains DEFAULT_ERRORBGCOLOR
        defaultSysThemeShouldBeFound("errorbgcolor.contains=" + DEFAULT_ERRORBGCOLOR);

        // Get all the sysThemeList where errorbgcolor contains UPDATED_ERRORBGCOLOR
        defaultSysThemeShouldNotBeFound("errorbgcolor.contains=" + UPDATED_ERRORBGCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByErrorbgcolorNotContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where errorbgcolor does not contain DEFAULT_ERRORBGCOLOR
        defaultSysThemeShouldNotBeFound("errorbgcolor.doesNotContain=" + DEFAULT_ERRORBGCOLOR);

        // Get all the sysThemeList where errorbgcolor does not contain UPDATED_ERRORBGCOLOR
        defaultSysThemeShouldBeFound("errorbgcolor.doesNotContain=" + UPDATED_ERRORBGCOLOR);
    }


    @Test
    @Transactional
    public void getAllSysThemesByProcessingcolorIsEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where processingcolor equals to DEFAULT_PROCESSINGCOLOR
        defaultSysThemeShouldBeFound("processingcolor.equals=" + DEFAULT_PROCESSINGCOLOR);

        // Get all the sysThemeList where processingcolor equals to UPDATED_PROCESSINGCOLOR
        defaultSysThemeShouldNotBeFound("processingcolor.equals=" + UPDATED_PROCESSINGCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByProcessingcolorIsNotEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where processingcolor not equals to DEFAULT_PROCESSINGCOLOR
        defaultSysThemeShouldNotBeFound("processingcolor.notEquals=" + DEFAULT_PROCESSINGCOLOR);

        // Get all the sysThemeList where processingcolor not equals to UPDATED_PROCESSINGCOLOR
        defaultSysThemeShouldBeFound("processingcolor.notEquals=" + UPDATED_PROCESSINGCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByProcessingcolorIsInShouldWork() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where processingcolor in DEFAULT_PROCESSINGCOLOR or UPDATED_PROCESSINGCOLOR
        defaultSysThemeShouldBeFound("processingcolor.in=" + DEFAULT_PROCESSINGCOLOR + "," + UPDATED_PROCESSINGCOLOR);

        // Get all the sysThemeList where processingcolor equals to UPDATED_PROCESSINGCOLOR
        defaultSysThemeShouldNotBeFound("processingcolor.in=" + UPDATED_PROCESSINGCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByProcessingcolorIsNullOrNotNull() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where processingcolor is not null
        defaultSysThemeShouldBeFound("processingcolor.specified=true");

        // Get all the sysThemeList where processingcolor is null
        defaultSysThemeShouldNotBeFound("processingcolor.specified=false");
    }
                @Test
    @Transactional
    public void getAllSysThemesByProcessingcolorContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where processingcolor contains DEFAULT_PROCESSINGCOLOR
        defaultSysThemeShouldBeFound("processingcolor.contains=" + DEFAULT_PROCESSINGCOLOR);

        // Get all the sysThemeList where processingcolor contains UPDATED_PROCESSINGCOLOR
        defaultSysThemeShouldNotBeFound("processingcolor.contains=" + UPDATED_PROCESSINGCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByProcessingcolorNotContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where processingcolor does not contain DEFAULT_PROCESSINGCOLOR
        defaultSysThemeShouldNotBeFound("processingcolor.doesNotContain=" + DEFAULT_PROCESSINGCOLOR);

        // Get all the sysThemeList where processingcolor does not contain UPDATED_PROCESSINGCOLOR
        defaultSysThemeShouldBeFound("processingcolor.doesNotContain=" + UPDATED_PROCESSINGCOLOR);
    }


    @Test
    @Transactional
    public void getAllSysThemesByHighlightcolorIsEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where highlightcolor equals to DEFAULT_HIGHLIGHTCOLOR
        defaultSysThemeShouldBeFound("highlightcolor.equals=" + DEFAULT_HIGHLIGHTCOLOR);

        // Get all the sysThemeList where highlightcolor equals to UPDATED_HIGHLIGHTCOLOR
        defaultSysThemeShouldNotBeFound("highlightcolor.equals=" + UPDATED_HIGHLIGHTCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByHighlightcolorIsNotEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where highlightcolor not equals to DEFAULT_HIGHLIGHTCOLOR
        defaultSysThemeShouldNotBeFound("highlightcolor.notEquals=" + DEFAULT_HIGHLIGHTCOLOR);

        // Get all the sysThemeList where highlightcolor not equals to UPDATED_HIGHLIGHTCOLOR
        defaultSysThemeShouldBeFound("highlightcolor.notEquals=" + UPDATED_HIGHLIGHTCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByHighlightcolorIsInShouldWork() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where highlightcolor in DEFAULT_HIGHLIGHTCOLOR or UPDATED_HIGHLIGHTCOLOR
        defaultSysThemeShouldBeFound("highlightcolor.in=" + DEFAULT_HIGHLIGHTCOLOR + "," + UPDATED_HIGHLIGHTCOLOR);

        // Get all the sysThemeList where highlightcolor equals to UPDATED_HIGHLIGHTCOLOR
        defaultSysThemeShouldNotBeFound("highlightcolor.in=" + UPDATED_HIGHLIGHTCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByHighlightcolorIsNullOrNotNull() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where highlightcolor is not null
        defaultSysThemeShouldBeFound("highlightcolor.specified=true");

        // Get all the sysThemeList where highlightcolor is null
        defaultSysThemeShouldNotBeFound("highlightcolor.specified=false");
    }
                @Test
    @Transactional
    public void getAllSysThemesByHighlightcolorContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where highlightcolor contains DEFAULT_HIGHLIGHTCOLOR
        defaultSysThemeShouldBeFound("highlightcolor.contains=" + DEFAULT_HIGHLIGHTCOLOR);

        // Get all the sysThemeList where highlightcolor contains UPDATED_HIGHLIGHTCOLOR
        defaultSysThemeShouldNotBeFound("highlightcolor.contains=" + UPDATED_HIGHLIGHTCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByHighlightcolorNotContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where highlightcolor does not contain DEFAULT_HIGHLIGHTCOLOR
        defaultSysThemeShouldNotBeFound("highlightcolor.doesNotContain=" + DEFAULT_HIGHLIGHTCOLOR);

        // Get all the sysThemeList where highlightcolor does not contain UPDATED_HIGHLIGHTCOLOR
        defaultSysThemeShouldBeFound("highlightcolor.doesNotContain=" + UPDATED_HIGHLIGHTCOLOR);
    }


    @Test
    @Transactional
    public void getAllSysThemesByLinkcolorIsEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where linkcolor equals to DEFAULT_LINKCOLOR
        defaultSysThemeShouldBeFound("linkcolor.equals=" + DEFAULT_LINKCOLOR);

        // Get all the sysThemeList where linkcolor equals to UPDATED_LINKCOLOR
        defaultSysThemeShouldNotBeFound("linkcolor.equals=" + UPDATED_LINKCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByLinkcolorIsNotEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where linkcolor not equals to DEFAULT_LINKCOLOR
        defaultSysThemeShouldNotBeFound("linkcolor.notEquals=" + DEFAULT_LINKCOLOR);

        // Get all the sysThemeList where linkcolor not equals to UPDATED_LINKCOLOR
        defaultSysThemeShouldBeFound("linkcolor.notEquals=" + UPDATED_LINKCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByLinkcolorIsInShouldWork() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where linkcolor in DEFAULT_LINKCOLOR or UPDATED_LINKCOLOR
        defaultSysThemeShouldBeFound("linkcolor.in=" + DEFAULT_LINKCOLOR + "," + UPDATED_LINKCOLOR);

        // Get all the sysThemeList where linkcolor equals to UPDATED_LINKCOLOR
        defaultSysThemeShouldNotBeFound("linkcolor.in=" + UPDATED_LINKCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByLinkcolorIsNullOrNotNull() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where linkcolor is not null
        defaultSysThemeShouldBeFound("linkcolor.specified=true");

        // Get all the sysThemeList where linkcolor is null
        defaultSysThemeShouldNotBeFound("linkcolor.specified=false");
    }
                @Test
    @Transactional
    public void getAllSysThemesByLinkcolorContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where linkcolor contains DEFAULT_LINKCOLOR
        defaultSysThemeShouldBeFound("linkcolor.contains=" + DEFAULT_LINKCOLOR);

        // Get all the sysThemeList where linkcolor contains UPDATED_LINKCOLOR
        defaultSysThemeShouldNotBeFound("linkcolor.contains=" + UPDATED_LINKCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByLinkcolorNotContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where linkcolor does not contain DEFAULT_LINKCOLOR
        defaultSysThemeShouldNotBeFound("linkcolor.doesNotContain=" + DEFAULT_LINKCOLOR);

        // Get all the sysThemeList where linkcolor does not contain UPDATED_LINKCOLOR
        defaultSysThemeShouldBeFound("linkcolor.doesNotContain=" + UPDATED_LINKCOLOR);
    }


    @Test
    @Transactional
    public void getAllSysThemesByNormalcolorIsEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where normalcolor equals to DEFAULT_NORMALCOLOR
        defaultSysThemeShouldBeFound("normalcolor.equals=" + DEFAULT_NORMALCOLOR);

        // Get all the sysThemeList where normalcolor equals to UPDATED_NORMALCOLOR
        defaultSysThemeShouldNotBeFound("normalcolor.equals=" + UPDATED_NORMALCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByNormalcolorIsNotEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where normalcolor not equals to DEFAULT_NORMALCOLOR
        defaultSysThemeShouldNotBeFound("normalcolor.notEquals=" + DEFAULT_NORMALCOLOR);

        // Get all the sysThemeList where normalcolor not equals to UPDATED_NORMALCOLOR
        defaultSysThemeShouldBeFound("normalcolor.notEquals=" + UPDATED_NORMALCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByNormalcolorIsInShouldWork() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where normalcolor in DEFAULT_NORMALCOLOR or UPDATED_NORMALCOLOR
        defaultSysThemeShouldBeFound("normalcolor.in=" + DEFAULT_NORMALCOLOR + "," + UPDATED_NORMALCOLOR);

        // Get all the sysThemeList where normalcolor equals to UPDATED_NORMALCOLOR
        defaultSysThemeShouldNotBeFound("normalcolor.in=" + UPDATED_NORMALCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByNormalcolorIsNullOrNotNull() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where normalcolor is not null
        defaultSysThemeShouldBeFound("normalcolor.specified=true");

        // Get all the sysThemeList where normalcolor is null
        defaultSysThemeShouldNotBeFound("normalcolor.specified=false");
    }
                @Test
    @Transactional
    public void getAllSysThemesByNormalcolorContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where normalcolor contains DEFAULT_NORMALCOLOR
        defaultSysThemeShouldBeFound("normalcolor.contains=" + DEFAULT_NORMALCOLOR);

        // Get all the sysThemeList where normalcolor contains UPDATED_NORMALCOLOR
        defaultSysThemeShouldNotBeFound("normalcolor.contains=" + UPDATED_NORMALCOLOR);
    }

    @Test
    @Transactional
    public void getAllSysThemesByNormalcolorNotContainsSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where normalcolor does not contain DEFAULT_NORMALCOLOR
        defaultSysThemeShouldNotBeFound("normalcolor.doesNotContain=" + DEFAULT_NORMALCOLOR);

        // Get all the sysThemeList where normalcolor does not contain UPDATED_NORMALCOLOR
        defaultSysThemeShouldBeFound("normalcolor.doesNotContain=" + UPDATED_NORMALCOLOR);
    }


    @Test
    @Transactional
    public void getAllSysThemesByTenantIdIsEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where tenantId equals to DEFAULT_TENANT_ID
        defaultSysThemeShouldBeFound("tenantId.equals=" + DEFAULT_TENANT_ID);

        // Get all the sysThemeList where tenantId equals to UPDATED_TENANT_ID
        defaultSysThemeShouldNotBeFound("tenantId.equals=" + UPDATED_TENANT_ID);
    }

    @Test
    @Transactional
    public void getAllSysThemesByTenantIdIsNotEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where tenantId not equals to DEFAULT_TENANT_ID
        defaultSysThemeShouldNotBeFound("tenantId.notEquals=" + DEFAULT_TENANT_ID);

        // Get all the sysThemeList where tenantId not equals to UPDATED_TENANT_ID
        defaultSysThemeShouldBeFound("tenantId.notEquals=" + UPDATED_TENANT_ID);
    }

    @Test
    @Transactional
    public void getAllSysThemesByTenantIdIsInShouldWork() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where tenantId in DEFAULT_TENANT_ID or UPDATED_TENANT_ID
        defaultSysThemeShouldBeFound("tenantId.in=" + DEFAULT_TENANT_ID + "," + UPDATED_TENANT_ID);

        // Get all the sysThemeList where tenantId equals to UPDATED_TENANT_ID
        defaultSysThemeShouldNotBeFound("tenantId.in=" + UPDATED_TENANT_ID);
    }

    @Test
    @Transactional
    public void getAllSysThemesByTenantIdIsNullOrNotNull() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where tenantId is not null
        defaultSysThemeShouldBeFound("tenantId.specified=true");

        // Get all the sysThemeList where tenantId is null
        defaultSysThemeShouldNotBeFound("tenantId.specified=false");
    }

    @Test
    @Transactional
    public void getAllSysThemesByTenantIdIsGreaterThanOrEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where tenantId is greater than or equal to DEFAULT_TENANT_ID
        defaultSysThemeShouldBeFound("tenantId.greaterThanOrEqual=" + DEFAULT_TENANT_ID);

        // Get all the sysThemeList where tenantId is greater than or equal to UPDATED_TENANT_ID
        defaultSysThemeShouldNotBeFound("tenantId.greaterThanOrEqual=" + UPDATED_TENANT_ID);
    }

    @Test
    @Transactional
    public void getAllSysThemesByTenantIdIsLessThanOrEqualToSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where tenantId is less than or equal to DEFAULT_TENANT_ID
        defaultSysThemeShouldBeFound("tenantId.lessThanOrEqual=" + DEFAULT_TENANT_ID);

        // Get all the sysThemeList where tenantId is less than or equal to SMALLER_TENANT_ID
        defaultSysThemeShouldNotBeFound("tenantId.lessThanOrEqual=" + SMALLER_TENANT_ID);
    }

    @Test
    @Transactional
    public void getAllSysThemesByTenantIdIsLessThanSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where tenantId is less than DEFAULT_TENANT_ID
        defaultSysThemeShouldNotBeFound("tenantId.lessThan=" + DEFAULT_TENANT_ID);

        // Get all the sysThemeList where tenantId is less than UPDATED_TENANT_ID
        defaultSysThemeShouldBeFound("tenantId.lessThan=" + UPDATED_TENANT_ID);
    }

    @Test
    @Transactional
    public void getAllSysThemesByTenantIdIsGreaterThanSomething() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        // Get all the sysThemeList where tenantId is greater than DEFAULT_TENANT_ID
        defaultSysThemeShouldNotBeFound("tenantId.greaterThan=" + DEFAULT_TENANT_ID);

        // Get all the sysThemeList where tenantId is greater than SMALLER_TENANT_ID
        defaultSysThemeShouldBeFound("tenantId.greaterThan=" + SMALLER_TENANT_ID);
    }

    /**
     * Executes the search, and checks that the default entity is returned.
     */
    private void defaultSysThemeShouldBeFound(String filter) throws Exception {
        restSysThemeMockMvc.perform(get("/api/sys-themes?sort=id,desc&" + filter))
            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
            .andExpect(jsonPath("$.[*].id").value(hasItem(sysTheme.getId().intValue())))
            .andExpect(jsonPath("$.[*].primarycolor").value(hasItem(DEFAULT_PRIMARYCOLOR)))
            .andExpect(jsonPath("$.[*].infocolor").value(hasItem(DEFAULT_INFOCOLOR)))
            .andExpect(jsonPath("$.[*].successcolor").value(hasItem(DEFAULT_SUCCESSCOLOR)))
            .andExpect(jsonPath("$.[*].warningcolor").value(hasItem(DEFAULT_WARNINGCOLOR)))
            .andExpect(jsonPath("$.[*].errorcolor").value(hasItem(DEFAULT_ERRORCOLOR)))
            .andExpect(jsonPath("$.[*].errorbgcolor").value(hasItem(DEFAULT_ERRORBGCOLOR)))
            .andExpect(jsonPath("$.[*].processingcolor").value(hasItem(DEFAULT_PROCESSINGCOLOR)))
            .andExpect(jsonPath("$.[*].highlightcolor").value(hasItem(DEFAULT_HIGHLIGHTCOLOR)))
            .andExpect(jsonPath("$.[*].linkcolor").value(hasItem(DEFAULT_LINKCOLOR)))
            .andExpect(jsonPath("$.[*].normalcolor").value(hasItem(DEFAULT_NORMALCOLOR)))
            .andExpect(jsonPath("$.[*].tenantId").value(hasItem(DEFAULT_TENANT_ID.intValue())));

        // Check, that the count call also returns 1
        restSysThemeMockMvc.perform(get("/api/sys-themes/count?sort=id,desc&" + filter))
            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
            .andExpect(content().string("1"));
    }

    /**
     * Executes the search, and checks that the default entity is not returned.
     */
    private void defaultSysThemeShouldNotBeFound(String filter) throws Exception {
        restSysThemeMockMvc.perform(get("/api/sys-themes?sort=id,desc&" + filter))
            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
            .andExpect(jsonPath("$").isArray())
            .andExpect(jsonPath("$").isEmpty());

        // Check, that the count call also returns 0
        restSysThemeMockMvc.perform(get("/api/sys-themes/count?sort=id,desc&" + filter))
            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
            .andExpect(content().string("0"));
    }

    @Test
    @Transactional
    public void getNonExistingSysTheme() throws Exception {
        // Get the sysTheme
        restSysThemeMockMvc.perform(get("/api/sys-themes/{id}", Long.MAX_VALUE))
            .andExpect(status().isNotFound());
    }

    @Test
    @Transactional
    public void updateSysTheme() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        int databaseSizeBeforeUpdate = sysThemeRepository.findAll().size();

        // Update the sysTheme
        SysTheme updatedSysTheme = sysThemeRepository.findById(sysTheme.getId()).get();
        // Disconnect from session so that the updates on updatedSysTheme are not directly saved in db
        em.detach(updatedSysTheme);
        updatedSysTheme
            .primarycolor(UPDATED_PRIMARYCOLOR)
            .infocolor(UPDATED_INFOCOLOR)
            .successcolor(UPDATED_SUCCESSCOLOR)
            .warningcolor(UPDATED_WARNINGCOLOR)
            .errorcolor(UPDATED_ERRORCOLOR)
            .errorbgcolor(UPDATED_ERRORBGCOLOR)
            .processingcolor(UPDATED_PROCESSINGCOLOR)
            .highlightcolor(UPDATED_HIGHLIGHTCOLOR)
            .linkcolor(UPDATED_LINKCOLOR)
            .normalcolor(UPDATED_NORMALCOLOR)
            .tenantId(UPDATED_TENANT_ID);
        SysThemeDTO sysThemeDTO = sysThemeMapper.toDto(updatedSysTheme);

        restSysThemeMockMvc.perform(put("/api/sys-themes").with(csrf())
            .contentType(MediaType.APPLICATION_JSON)
            .content(TestUtil.convertObjectToJsonBytes(sysThemeDTO)))
            .andExpect(status().isOk());

        // Validate the SysTheme in the database
        List<SysTheme> sysThemeList = sysThemeRepository.findAll();
        assertThat(sysThemeList).hasSize(databaseSizeBeforeUpdate);
        SysTheme testSysTheme = sysThemeList.get(sysThemeList.size() - 1);
        assertThat(testSysTheme.getPrimarycolor()).isEqualTo(UPDATED_PRIMARYCOLOR);
        assertThat(testSysTheme.getInfocolor()).isEqualTo(UPDATED_INFOCOLOR);
        assertThat(testSysTheme.getSuccesscolor()).isEqualTo(UPDATED_SUCCESSCOLOR);
        assertThat(testSysTheme.getWarningcolor()).isEqualTo(UPDATED_WARNINGCOLOR);
        assertThat(testSysTheme.getErrorcolor()).isEqualTo(UPDATED_ERRORCOLOR);
        assertThat(testSysTheme.getErrorbgcolor()).isEqualTo(UPDATED_ERRORBGCOLOR);
        assertThat(testSysTheme.getProcessingcolor()).isEqualTo(UPDATED_PROCESSINGCOLOR);
        assertThat(testSysTheme.getHighlightcolor()).isEqualTo(UPDATED_HIGHLIGHTCOLOR);
        assertThat(testSysTheme.getLinkcolor()).isEqualTo(UPDATED_LINKCOLOR);
        assertThat(testSysTheme.getNormalcolor()).isEqualTo(UPDATED_NORMALCOLOR);
        assertThat(testSysTheme.getTenantId()).isEqualTo(UPDATED_TENANT_ID);
    }

    @Test
    @Transactional
    public void updateNonExistingSysTheme() throws Exception {
        int databaseSizeBeforeUpdate = sysThemeRepository.findAll().size();

        // Create the SysTheme
        SysThemeDTO sysThemeDTO = sysThemeMapper.toDto(sysTheme);

        // If the entity doesn't have an ID, it will throw BadRequestAlertException
        restSysThemeMockMvc.perform(put("/api/sys-themes").with(csrf())
            .contentType(MediaType.APPLICATION_JSON)
            .content(TestUtil.convertObjectToJsonBytes(sysThemeDTO)))
            .andExpect(status().isBadRequest());

        // Validate the SysTheme in the database
        List<SysTheme> sysThemeList = sysThemeRepository.findAll();
        assertThat(sysThemeList).hasSize(databaseSizeBeforeUpdate);
    }

    @Test
    @Transactional
    public void deleteSysTheme() throws Exception {
        // Initialize the database
        sysThemeRepository.saveAndFlush(sysTheme);

        int databaseSizeBeforeDelete = sysThemeRepository.findAll().size();

        // Delete the sysTheme
        restSysThemeMockMvc.perform(delete("/api/sys-themes/{id}", sysTheme.getId()).with(csrf())
            .accept(MediaType.APPLICATION_JSON))
            .andExpect(status().isNoContent());

        // Validate the database contains one less item
        List<SysTheme> sysThemeList = sysThemeRepository.findAll();
        assertThat(sysThemeList).hasSize(databaseSizeBeforeDelete - 1);
    }
}
